//统一管理产品相关的接口
import mockRequest from '@/utils/mockRequest'
import type { resProductShowData, resBannerData } from './type'
//项目用户相关的请求地址
enum API {
    PRO_SHOW_URL = '/productShow',
    BANNER_URL = '/banner',
    PRO_URL = '/products',
    PRO_INFO_URL = '/product',
    TM_URL = '/trademark'
}

// 获取轮播图数据
export const reqGetBanner = () => mockRequest.get<any, resBannerData>(API.BANNER_URL)
// 获取产品展示数据
export const reqGetProductShow = () => mockRequest.get<any, resProductShowData>(API.PRO_SHOW_URL)

// 获取产品分页列表数据
export const reqGetProducts = (data: any) => mockRequest.get<any, any>(API.PRO_URL, { data: data })
// 通过id获取产品信息
export const reqGetProduct = (id: number) => mockRequest.get<any, any>(API.PRO_INFO_URL, { data: id })

// 获取品牌列表数据
export const reqGetTm = () => mockRequest.get<any, any>(API.TM_URL)